package com.javatest.ajax.app3.dao;

import com.javatest.ajax.app3.bean.Employee;
import com.javatest.dao.DaoBase;

import java.util.List;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2018/9/5 17:58
 */
public class EmployeeDao extends DaoBase<Employee> implements IEmployeeDao {

    @Override
    public List<Employee> getEmployees(int departmentId) {
        String sql = "SELECT employee_id as employeeId, last_name as lastName, email, salary FROM employees WHERE department_id=?";
        return getForList(sql, departmentId);
    }

    @Override
    public Employee getEmployee(int employeeId) {
        String sql = "SELECT employee_id as employeeId, last_name as lastName, email, salary FROM employees WHERE employee_id=?";
        return get(sql, employeeId);
    }
}
